]> dgit.raspbian.org Git - gnome-shell.git/commit
iconGrid: Cache max size of children
authorJonas Dreßler <verdre@v0yd.nl>
Tue, 23 Feb 2021 18:47:45 +0000 (19:47 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 3 Mar 2021 17:59:15 +0000 (17:59 +0000)
commitb3c46a33c0dd39a4257937a7ad12bc0cfb8813ef
tree6f87b2b5c3b3ab24c1f7d689d1f6e307762690d6
parent0a144ee54fdfd11be7968c4d799d821ad30d9575
iconGrid: Cache max size of children

We call this._getChildrenMaxSize() from the allocate() vfunc of
IconGridLayout. Since the function is quite expensive, it slows the
layout process down a lot, so instead of re-calculating it on every
relayout, cache the max size of children.

This makes the average time spent in vfunc_allocate() of the iconGrid go
down from 2.3 ms to 1.6 ms.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1713>
js/ui/iconGrid.js